﻿@{
    Layout = null;
}
<input type="hidden" value="@ViewBag.FavCount" id="FavCount" />
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="table table-grey">
    <thead class='th-wr'>
        <tr class="thead">
            <th class="tdnum tdnum1" style="width:30px">序号</th>
            <th >分类名称</th>
            <th style="width:90px">操作</th>
        </tr>
    </thead>
    <tbody>
        @{if (ViewBag.FavList != null && ViewBag.FavCount > 0)
            {
                int sortno = ViewBag.PageSize * (ViewBag.PageNow - 1) + 1;
                foreach (System.Data.DataRow dr in ViewBag.FavList.Rows)
                {
                    string str = "even";
                    if (sortno % 2 == 0)
                    {
                        str = "odd";
                    }

                    <tr class='@str'>
                        <td>@sortno</td>
                        <td class="tc">@dr["CategoryName"]</td>
                        <td class="tc">
                            <a href="javascript:void(0);" onclick="javascript:editCate('@dr["CategoryName"]','@dr["FavoriteCategoryID"]')">编辑</a>
                            <a href="javascript:void(0);" onclick="delCate('@dr["FavoriteCategoryID"]')">删除</a>
                        </td>
                    </tr>
                    sortno = sortno + 1;
                }
            }
        }
    </tbody>
</table>
@*//分页*@
<div class="pagenav pagenav-02">
    @*上一页*@
    @if (ViewBag.TotalPage > 0)
    {
        if (ViewBag.PageNow != 1)
        {
            int thispage = ViewBag.PageNow - 1;
            <a href="javascript:void(0);" class="page-prev" onclick="searchPageNew('@thispage')">上一页</a>
        }
        else
        {
            <a href="javascript:return false;" onclick="return false" class="page-prev disable">上一页</a>
        }
        @*循环初始化页码*@
    foreach (string numpage in ViewBag.PageList)
    {
        if (numpage != "0")
        {
            int m = int.Parse(numpage);
            if (m == ViewBag.PageNow)
            {
                <a href="javascript:void(0);" class="active" onclick="searchPageNew('@numpage')">@numpage</a>

            }
            else
            {
                <a href="javascript:void(0);" onclick="searchPageNew('@numpage')">@numpage</a>
            }

        }
        else
        {
            <i class="iconfont icon-dian2"></i>
        }

    }
    @*下一页*@
    if (ViewBag.TotalPage > 0 && ViewBag.PageNow != ViewBag.TotalPage)
    {
        int nextpage = ViewBag.PageNow + 1;
        <a href="javascript:void(0);" class="page-next" onclick="searchPageNew('@nextpage')">下一页</a>
    }
    else
    {
        <a href="javascript:return false;" onclick="return false" class="page-prev disable">下一页</a>
        }
    }
    @if (@ViewBag.Count == 0)
    {
        <label>暂无数据！</label>

    }
    else
    {

        <label>共 </label>
        <label>@ViewBag.Count </label>
        <label>条数据 </label>
    }
</div>



